package cn.cdeden.knowledge.mapper;

import cn.cdeden.knowledge.domain.SysUserPermissions;
import cn.cdeden.knowledge.domain.dto.SysUserPermissionsDto;
import cn.cdeden.knowledge.domain.dto.UserAuthorityDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserPermissionsMapper extends BaseMapper<SysUserPermissions> {

    IPage<UserAuthorityDto> getUserPermissions(@Param("id") Long id, @Param("userName") String userName, @Param("permissionsId") Long permissionsId, IPage<UserAuthorityDto> page);

    Boolean updateBatchByScheduleId(@Param("scheduleId") Long scheduleId, @Param("permissionsId") Long permissionsId, @Param("userIds") List<Long> userIds);

    Boolean addByBatch(@Param("sysUserPermissionsDto") SysUserPermissionsDto sysUserPermissionsDto);
}
